home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / NT / CODE / CHAP12 / VISTA / VISTA.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.0 KB  |  45 lines

  1. //***********************************************************************
  2. //
  3. //  Vista.cpp
  4. //
  5. //***********************************************************************
  6.  
  7. #include <afxwin.h>
  8. #include <afxext.h>
  9. #include "Resource.h"
  10. #include "Vista.h"
  11. #include "MainFrame.h"
  12. #include "VistaDoc.h"
  13. #include "VistaView.h"
  14.  
  15. CVistaApp myApp;
  16.  
  17. BEGIN_MESSAGE_MAP (CVistaApp, CWinApp)
  18.     ON_COMMAND (ID_FILE_OPEN, CWinApp::OnFileOpen)
  19. END_MESSAGE_MAP ()
  20.  
  21. BOOL CVistaApp::InitInstance ()
  22. {
  23.     SetRegistryKey ("Programming Windows 95 with MFC");
  24.     LoadStdProfileSettings ();
  25.  
  26.     CSingleDocTemplate* pDocTemplate;
  27.     pDocTemplate = new CSingleDocTemplate (
  28.         IDR_MAINFRAME,
  29.         RUNTIME_CLASS (CVistaDoc),
  30.         RUNTIME_CLASS (CMainFrame),
  31.         RUNTIME_CLASS (CVistaView)
  32.     );
  33.  
  34.     AddDocTemplate (pDocTemplate);
  35.  
  36.     CCommandLineInfo cmdInfo;
  37.     ParseCommandLine (cmdInfo);
  38.  
  39.     if (!ProcessShellCommand (cmdInfo))
  40.         return FALSE;
  41.  
  42.     m_pMainWnd->DragAcceptFiles ();
  43.     return TRUE;
  44. }
  45.